package csu.ssd.student;

import csu.ssd.student.Dao.studentDao;
import csu.ssd.student.vo.Student;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;

import java.net.URL;
import java.util.List;
import java.util.ResourceBundle;

public class tongController implements Initializable {
    @FXML
    private TableView<Student> tong;

    @FXML
    private TableColumn<Student, String> tkemu;

    @FXML
    private TableColumn<Student, String> tname;

    @FXML
    private TableColumn<Student, Integer> tlast;

    private ObservableList<Student> RoleData = FXCollections.observableArrayList();

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        studentDao m=new studentDao();
        List<Student> list= m.getRole();
        int mm=1;
        for (Student f : list) {

            if ( f.getLast()==100)
            {
                RoleData.add(f);

                //finishtowait.setCellValueFactory(cellData ->cellData.getValue().cb.getCheckBox());
                tkemu.setCellValueFactory(new PropertyValueFactory<>("kemu"));
                tlast.setCellValueFactory(new PropertyValueFactory<>("last"));
                tname.setCellValueFactory(new PropertyValueFactory<>("name"));

                //  finishren.setCellValueFactory(new PropertyValueFactory<>("name"));
                tong.setItems(RoleData);

            }
        }

    }
}
